package com.sky.context;

public class BaseContext {

    public static ThreadLocal<Long> threadLocal = new ThreadLocal<>();

    public static void setCurrentId(Long id) {
        threadLocal.set(id);
    }

    public static Long getCurrentId() {
        return threadLocal.get();
    }

    public static void removeCurrentId() {
        threadLocal.remove();
    }
    /**
     * 线程变量表明身份
     * */
    public static ThreadLocal<String> threadLocalRole = new ThreadLocal<>();

    public static void setRole(String role) {
        threadLocalRole.set(role);
    }

    public static String getRole() {
        return threadLocalRole.get();
    }

    public static void removeRole() {
        threadLocalRole.remove();
    }

}
